import { createRouter, createWebHashHistory } from 'vue-router'

import previewView from '../views/preview/index.vue'
import Home from '../views/home/index.vue'
const routes = [
  {
    path: '/',
    redirect: '/preview',

  },
  //引导
  {
    path: '/preview',
    name: 'preview',
    redirect: '/preview/guide1',
    component: previewView,
    meta: {
      title: '引导'
    },
    children: [
      {
        path: 'guide1',
        name: 'guide1',
        component: () => import('../views/preview/guide1.vue'),
      },
      {
        path: 'guide2',
        name: 'guide2',
        component: () => import('../views/preview/guide2.vue'),
      },
      {
        path: 'guide3',
        name: 'guide3',
        component: () => import('../views/preview/guide3.vue'),
      },

    ]
  },
  //我的
  {
    path: '/my',
    name: 'my',
    meta: {
      title: '我的'
    },
    component: () => import('../views/my/index.vue'),
  },
  {
    path: '/updateUserInfo',
    name: 'updateUserInfo',
    component: () => import('../views/my/updateUserInfo.vue'),
  },

  {
    path: '/selfsetting',
    name: 'selfsetting',
    component: () => import('../views/my/selfsetting.vue'),
  },
  {
    path: '/updatepsw',
    name: 'updatepsw',
    component: () => import('../views/my/updatepsw.vue'),
  },
  {
    path: '/collection',
    name: 'collection',
    meta: {
      title: '收藏'
    },
    component: () => import('../views/collection/index.vue'),
  },
  //登录
  {
    path: '/login',
    name: 'login',
    meta: {
      title: '登录'
    },
    component: () => import('../views/login/index.vue'),
    children: [
      {
        path: 'mobile',
        name: 'mobile',
        component: () => import('../views/login/mobileLogin.vue'),
      },
      {
        path: 'code',
        name: 'code',
        component: () => import('../views/login/code.vue'),
      },
      {
        path: 'userlogin',
        name: 'userlogin',
        component: () => import('../views/login/userLogin.vue'),
      },
      {
        path: 'forgetPassword',
        name: 'forgetPassword',
        component: () => import('../views/login/forgetPassword.vue'),
      },
    
    ]
  },
  //搜索
  {
    path: '/search',
    name: 'search',
    meta: {
      title: '搜索'
    },
    component: () => import('../views/search/index.vue'),
  },
  //主页
  {
    path: '/home',
    name: 'home',
    meta: {
      title: '主页'
    },
    component:Home,
    children:[
      {
        path:'summary/:id',
        name:'summary',
        component:()=>import('../views/home/coursedetailSummary.vue'),
        // children:[
        //   {
        //     path:'summary1',
        //     name:'summary1',
        //     component:()=>import('../views/home/coursedetailSummary1.vue'),
        //   },
        //   {
        //     path:'summary2',
        //     name:'summary2',
        //     component:()=>import('../views/home/coursedetailSummary2.vue'),
        //   },
        //   {
        //     path:'summary3',
        //     name:'summary3',
        //     component:()=>import('../views/home/coursedetailSummary3.vue'),
        //   },
        //   {
        //     path:'summary4',
        //     name:'summary4',
        //     component:()=>import('../views/home/coursedetailSummary4.vue'),
        //   },
        //   {
        //     path:'summary5',
        //     name:'summary5',
        //     component:()=>import('../views/home/coursedetailSummary5.vue'),
        //   }
         
        // ]
      },
      {
        path:'courseListView',
        name:'courseListView',
        component:()=>import('../views/home/courseListView.vue'),
      },
      {
        path:'teacherListView',
        name:'teacherListView',
        component:()=>import('../views/home/teacherListView.vue'),
      },
      {
        path:'coursedetalCourse',
        name:'coursedetalCourse',
        component:()=>import('../views/home/coursedetalCourse.vue'),
      },
      
    ]
  },

 
]
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes,
})

export default router
